/*
 * 23/10/2011 - 16:46
 */
package org.nettyflux.netmessages;

import org.nettyflux.communicator.RemoteHost;

/**
 * @author Victor Williams Stafusa da Silva
 */
public final class MessageReceived<R extends RemoteHost> implements NetworkMessage {

    private final byte[] message;
    private final R sender;

    public MessageReceived(R sender, byte[] message) {
        this.message = message;
        this.sender = sender;
    }

    public static <R extends RemoteHost> MessageReceived<R> create(R receiver, byte[] message) {
        return new MessageReceived<R>(receiver, message);
    }

    public byte[] getMessage() {
        return message;
    }

    public R getSender() {
        return sender;
    }
}
